package com.dpiinc.TechPage.room.dao;
import com.dpiinc.TechPage.room.bean.RecognizeEntity;

import java.util.List;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

/**
 * Created by hu489_000 on 2018-07-01.
 */

@Dao
public interface RecognizeDao {

    @Query("SELECT * FROM RecognizeEntity")
    List<RecognizeEntity> getAll();

    @Query("SELECT * FROM RecognizeEntity WHERE noteId IN (:noteIds)")
    List<RecognizeEntity> getAllByIds(long[] noteIds);

    @Query("SELECT * FROM RecognizeEntity WHERE noteId = :noteId ")
    RecognizeEntity getRecognizeByNoteId(String noteId);

    @Insert
    void insert(RecognizeEntity... entities);

    @Query("DELETE FROM RecognizeEntity")
    public void clearTable();

    @Delete
    void delete(RecognizeEntity entity);

    @Update
    void update(RecognizeEntity entity);
}
